package com.saodisheng.controller;

import com.saodisheng.service.AdminIndexService;
import com.saodisheng.service.AdminTagService;
import org.springframework.beans.factory.annotation.Autowired;

public class AdminTagController extends BaseController {
	@Autowired
	private AdminTagService tagService;
	@Autowired
	private AdminIndexService indexService;
	public void index() {
		setAttr("tags", tagService.getAllTag());
		setAttr("postNum", indexService.getPostNum());
		render("index.html");
	}
	
	public void list() {
		setAttr("postPage", tagService.getPostPageByTag(getPara("tag"), getParaToInt("p", 1)));
		
		render("post_list.html");
	}
}
